package xiao.trip.dao;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;
import xiao.trip.Do.shopDO;

import java.util.List;

@Mapper
@Service
public interface shopDAO {
    @Select("select * from shop")
    public List<shopDO> select_all();
    @Select("select * from shop where shopId=#{shopId}")
    public List<shopDO> select_Id(String shopId);
    @Insert("insert into shop value (#{shopTitle},#{trait},#{lowPrice},#{username},#{userphone},#{shopId},#{hp},#{count})")
    public int insert_all(String shopTitle,String trait,Double lowPrice,String username,String userphone,String shopId,String hp,int count);
    @Delete("delete from shop where shopId=#{shopId}")
    public int delete_Id(String shopId);
    @Select("select shopId from shop where count=0")
    public List<shopDO> select_count();
    @Update("update shop set count=count-1 where shopId=#{shopId}")
    public int update_count(String shopId);
}
